#include "ClamAVScanJob.h"
#include "ScanResult.h"
#include <iostream>

namespace GPUCC
{
	ClamAVScanJob::ClamAVScanJob(const std::string& Path, ClamAVScanner& Scanner, InfectedHandler& Instance) : m_Path(Path), m_Scanner(Scanner), m_Engine(Instance)
	{
	}

	ClamAVScanJob::~ClamAVScanJob()
	{
	}

	void ClamAVScanJob::Run()
	{
		ScanResult Result;

		if (this->m_Scanner.ScanFile(this->m_Path, Result))
		{
			if (Result.GetInfected())
			{
				this->m_Engine.OnInfected(this->m_Path, Result.GetSignature());
			}
		}
	}
}